home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hardcore Visual Basic 5.0 (2nd Edition)
/
Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso
/
Source
/
WinTlb
/
WINNETWK.IDL
< prev
next >
Wrap
Text File
|
1996-07-10
|
17KB
|
515 lines
// Network API types, constants, and functions
typedef struct NETRESOURCE {
DWORD dwScope;
DWORD dwType;
DWORD dwDisplayType;
DWORD dwUsage;
LPTSTR lpLocalName;
LPTSTR lpRemoteName;
LPTSTR lpComment ;
LPTSTR lpProvider;
} NETRESOURCE;
typedef struct CONNECTDLGSTRUCT {
DWORD cbStructure; // size of this structure in bytes
HWND hwndOwner; // owner window for the dialog
// DWORD NETRESOURCE lpConnRes; // Requested Resource info
DWORD dwFlags; // flags (see below)
DWORD dwDevNum; // number of devices connected to
} CONNECTDLGSTRUCT;
typedef struct UNIVERSAL_NAME_INFO {
LPTSTR lpUniversalName;
} UNIVERSAL_NAME_INFO;
typedef struct REMOTE_NAME_INFO {
LPTSTR lpUniversalName;
LPTSTR lpConnectionName;
LPTSTR lpRemainingPath;
} REMOTE_NAME_INFO;
typedef struct NETINFOSTRUCT {
DWORD cbStructure;
DWORD dwProviderVersion;
DWORD dwStatus;
DWORD dwCharacteristics;
DWORD dwHandle;
WORD wNetType;
DWORD dwPrinters;
DWORD dwDrives;
} NETINFOSTRUCT;
typedef struct DISCDLGSTRUCT {
DWORD cbStructure; // size of this structure in bytes
HWND hwndOwner; // owner window for the dialog
LPTSTR lpLocalName; // local device name
LPTSTR lpRemoteName; // network resource name
DWORD dwFlags; // flags
} DISCDLGSTRUCT;
typedef struct NETCONNECTINFOSTRUCT {
DWORD cbStructure;
DWORD dwFlags;
DWORD dwSpeed;
DWORD dwDelay;
DWORD dwOptDataSize;
} NETCONNECTINFOSTRUCT;
typedef LONG PFNPROCESSPOLICIES;
// BOOL (FAR PASCAL *PFNPROCESSPOLICIESA) (
// HWND hwnd,
// LPCTSTR pszPath,
// LPCTSTR pszUsername,
// LPCTSTR pszComputerName,
// DWORD dwFlags
// );
typedef LONG PFNGETPROFILEPATH;
//
// typedef UINT (FAR PASCAL *PFNGETPROFILEPATHA) (
// LPCTSTR pszUsername,
// LPTSTR pszBuffer,
// UINT cbBuffer
// );
typedef LONG PFNRECONCILEPROFILE;
// typedef UINT (FAR PASCAL *PFNRECONCILEPROFILEA) (
// LPCTSTR pszCentralFile,
// LPCTSTR pszLocalFile,
// DWORD dwFlags
// );
[
#ifdef UNICODE
uuid(64675050-3A82-101B-8181-00AA003743D3),
#else
uuid(64674050-3A82-101B-8181-00AA003743D3),
#endif
helpstring("Networks"),
dllname("MPR.DLL")
]
module Network {
// Errors
[ helpstring("WNet: Function succeeded") ]
const UINT WN_SUCCESS = 0x0000;
[ helpstring("WNet: Function not supported") ]
const UINT WN_NOT_SUPPORTED = 0x0001;
[ helpstring("WNet: Network error") ]
const UINT WN_NET_ERROR = 0x0002;
[ helpstring("WNet: Buffer too small") ]
const UINT WN_MORE_DATA = 0x0003;
[ helpstring("WNet: A pointer value was invalid") ]
const UINT WN_BAD_POINTER = 0x0004;
[ helpstring("WNet: Local name invalid") ]
const UINT WN_BAD_VALUE = 0x0005;
[ helpstring("WNet: Invalid password") ]
const UINT WN_BAD_PASSWORD = 0x0006;
[ helpstring("WNet: A security violation occurred") ]
const UINT WN_ACCESS_DENIED = 0x0007;
[ helpstring("WNet: The requested resource is in use") ]
const UINT WN_FUNCTION_BUSY = 0x0008;
[ helpstring("WNet: Unexpected error") ]
const UINT WN_WINDOWS_ERROR = 0x0009;
[ helpstring("WNet: Invalid user") ]
const UINT WN_BAD_USER = 0x000A;
[ helpstring("WNet: System out of memory") ]
const UINT WN_OUT_OF_MEMORY = 0x000B;
[ helpstring("WNet: Canceled by user") ]
const UINT WN_CANCEL = 0x000C;
[ helpstring("WNet: Continued by user") ]
const UINT WN_CONTINUE = 0x000D;
// Connection errors
[ helpstring("WNet: Network connection does not exist") ]
const UINT WN_NOT_CONNECTED = 0x0030;
[ helpstring("WNet: Files are open, but force not specified") ]
const UINT WN_OPEN_FILES = 0x0031;
[ helpstring("WNet: Remote name invalid or already connected") ]
const UINT WN_BAD_NETNAME = 0x0032;
[ helpstring("WNet: Local name invalid") ]
const UINT WN_BAD_LOCALNAME = 0x0033;
[ helpstring("WNet: Local device already in use") ]
const UINT WN_ALREADY_CONNECTED = 0x0034;
[ helpstring("WNet: Device not functioning") ]
const UINT WN_DEVICE_ERROR = 0x0035;
[ helpstring("WNet: Device not currently connected, but is a remembered connection") ]
const UINT WN_CONNECTION_CLOSED = 0x0036;
// ****** Network support *******
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetAddConnectionW"),
#else
entry("WNetAddConnectionA"),
#endif
helpstring("Redirects a local device to a shared devices or remote server"),
]
UINT WINAPI WNetAddConnection(LPTSTR lpszNetPath,
LPTSTR lpszPassword,
LPTSTR lpszLocalName);
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetGetUserW"),
#else
entry("WNetGetUserA"),
#endif
helpstring("Gets the user name"),
]
UINT WINAPI WNetGetUser(LPTSTR lpszBuffer,
UINT * cbBuffer);
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetGetConnectionW"),
#else
entry("WNetGetConnectionA"),
#endif
helpstring("Gets the name of the shared devices associated with the given local device"),
]
UINT WINAPI WNetGetConnection(LPTSTR lpszLocalName,
LPTSTR lpszRemoteName,
UINT * cbRemoteName);
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetCancelConnectionW"),
#else
entry("WNetCancelConnectionA"),
#endif
helpstring("Cancels a network connection device, forcing open connections to close if fForce is true"),
]
UINT WINAPI WNetCancelConnection(LPTSTR lpszName,
BOOL fForce);
[
usesgetlasterror,
entry("WNetConnectionDialog"),
helpstring("Starts a browsing dialog for connecting to network resources"),
]
UINT WINAPI WNetConnectionDialog(UINT hWnd,
UINT fdwResourceType);
[
usesgetlasterror,
entry("WNetDisconnectDialog"),
helpstring("Starts a browsing dialog for disconnecting a network resource"),
]
DWORD WINAPI WNetDisconnectDialog(HWND hwnd,
DWORD dwType);
const long RESOURCETYPE_ANY = 0x00000000;
const long RESOURCETYPE_DISK = 0x00000001;
const long RESOURCETYPE_PRINT = 0x00000002;
const long RESOURCETYPE_UNKNOWN = 0xFFFFFFFF;
const long RESOURCETYPE_RESERVED = 0x00000008;
const DWORD RESOURCE_CONNECTED = 0x00000001;
const DWORD RESOURCE_GLOBALNET = 0x00000002;
const DWORD RESOURCE_REMEMBERED = 0x00000003;
const DWORD RESOURCE_RECENT = 0x00000004;
const DWORD RESOURCE_CONTEXT = 0x00000005;
const DWORD RESOURCEUSAGE_CONNECTABLE = 0x00000001;
const DWORD RESOURCEUSAGE_CONTAINER = 0x00000002;
const DWORD RESOURCEUSAGE_NOLOCALDEVICE = 0x00000004;
const DWORD RESOURCEUSAGE_SIBLING = 0x00000008;
const DWORD RESOURCEUSAGE_ALL = 0x00000003; // RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER
const DWORD RESOURCEUSAGE_RESERVED = 0x80000000;
const DWORD RESOURCEDISPLAYTYPE_GENERIC = 0x00000000;
const DWORD RESOURCEDISPLAYTYPE_DOMAIN = 0x00000001;
const DWORD RESOURCEDISPLAYTYPE_SERVER = 0x00000002;
const DWORD RESOURCEDISPLAYTYPE_SHARE = 0x00000003;
const DWORD RESOURCEDISPLAYTYPE_FILE = 0x00000004;
const DWORD RESOURCEDISPLAYTYPE_GROUP = 0x00000005;
const DWORD RESOURCEDISPLAYTYPE_NETWORK = 0x00000006;
const DWORD RESOURCEDISPLAYTYPE_ROOT = 0x00000007;
const DWORD RESOURCEDISPLAYTYPE_SHAREADMIN = 0x00000008;
const DWORD RESOURCEDISPLAYTYPE_DIRECTORY = 0x00000009;
const DWORD RESOURCEDISPLAYTYPE_TREE = 0x0000000A;
// Network Connections
const int NETPROPERTY_PERSISTENT = 1;
const DWORD CONNECT_UPDATE_PROFILE = 0x00000001;
const DWORD CONNECT_UPDATE_RECENT = 0x00000002;
const DWORD CONNECT_TEMPORARY = 0x00000004;
const DWORD CONNECT_INTERACTIVE = 0x00000008;
const DWORD CONNECT_PROMPT = 0x00000010;
const DWORD CONNECT_NEED_DRIVE = 0x00000020;
const DWORD CONNECT_REFCOUNT = 0x00000040;
const DWORD CONNECT_REDIRECT = 0x00000080;
const DWORD CONNECT_LOCALDRIVE = 0x00000100;
const DWORD CONNECT_CURRENT_MEDIA = 0x00000200;
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetAddConnection2W"),
#else
entry("WNetAddConnection2A"),
#endif
helpstring("Makes a connection to a network resource"),
]
DWORD WINAPI WNetAddConnection2(NETRESOURCE * lpNetResource,
LPCTSTR lpPassword,
LPCTSTR lpUserName,
DWORD dwFlags);
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetAddConnection3W"),
#else
entry("WNetAddConnection3A"),
#endif
helpstring("Makes a connection to a network resource"),
]
DWORD WINAPI WNetAddConnection3(HWND hwndOwner,
NETRESOURCE * lpNetResource,
LPCTSTR lpPassword,
LPCTSTR lpUserName,
DWORD dwFlags);
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetCancelConnection2W"),
#else
entry("WNetCancelConnection2A"),
#endif
helpstring("Breaks an existing network connection, or removes remembered connections that are not currently connected"),
]
DWORD WINAPI WNetCancelConnection2(LPCTSTR lpName,
DWORD dwFlags,
BOOL fForce);
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetUseConnectionW"),
#else
entry("WNetUseConnectionA"),
#endif
helpstring("Establishes connection to a network object, usually for browsing"),
]
DWORD WINAPI WNetUseConnection(HWND hwndOwner,
NETRESOURCE * lpNetResource,
LPCTSTR lpUserID,
LPCTSTR lpPassword,
DWORD dwFlags,
LPTSTR lpAccessName,
DWORD * lpBufferSize,
DWORD * lpResult);
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetSetConnectionW"),
#else
entry("WNetSetConnectionA"),
#endif
helpstring("Changes the characteristics of a network connection"),
]
DWORD WINAPI WNetSetConnection(LPCTSTR lpName,
DWORD dwProperties,
void * pvValues);
// Network Connection Dialogs.
const DWORD CONNDLG_RO_PATH = 0x00000001; // Resource path should be read-only
const DWORD CONNDLG_CONN_POINT = 0x00000002; // Netware -style movable connection point enabled
const DWORD CONNDLG_USE_MRU = 0x00000004; // Use MRU combobox
const DWORD CONNDLG_HIDE_BOX = 0x00000008; // Hide persistent connect checkbox
// NOTE: Set at most ONE of the below flags. If neither flag is set,
// then the persistence is set to whatever the user chose during
// a previous connection
const DWORD CONNDLG_PERSIST = 0x00000010; // Force persistent connection
const DWORD CONNDLG_NOT_PERSIST = 0x00000020; // Force connection NOT persistent
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetConnectionDialog1W"),
#else
entry("WNetConnectionDialog1A"),
#endif
helpstring("Brings up a general browsing dialog for connection to network resources"),
]
DWORD WINAPI WNetConnectionDialog1(CONNECTDLGSTRUCT * lpConnDlgStruct);
const DWORD DISC_UPDATE_PROFILE = 0x00000001;
const DWORD DISC_NO_FORCE = 0x00000040;
[
usesgetlasterror,
entry("WNetDisconnectDialog1"),
helpstring("Disconnects a network resource, prompting for confirmation if files are open"),
]
DWORD WINAPI WNetDisconnectDialog1(DISCDLGSTRUCT * lpConnDlgStruct);
// Network Browsing.
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetOpenEnumW"),
#else
entry("WNetOpenEnumA"),
#endif
helpstring("Starts an enumeration of network resources or existing connections"),
]
DWORD WINAPI WNetOpenEnum(
DWORD dwScope,
DWORD dwType,
DWORD dwUsage,
NETRESOURCE * lpNetResource,
HANDLE * lphEnum
);
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetEnumResourceW"),
#else
entry("WNetEnumResourceA"),
#endif
helpstring("Continues a network-resource enumeration started WNetOpenEnum"),
]
DWORD WINAPI WNetEnumResource(
HANDLE hEnum,
DWORD * lpcCount,
void * lpBuffer,
DWORD * lpBufferSize
);
[
usesgetlasterror,
entry("WNetCloseEnum"),
helpstring("Ends a network resource enumeration started by WNetOpenEnum"),
]
DWORD WINAPI WNetCloseEnum(HANDLE hEnum);
// Universal Naming.
const DWORD UNIVERSAL_NAME_INFO_LEVEL = 0x00000001;
const DWORD REMOTE_NAME_INFO_LEVEL = 0x00000002;
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetGetUniversalNameW"),
#else
entry("WNetGetUniversalNameA"),
#endif
helpstring("Takes a drive-based path for a network resource and obtains a data structure that contains a more universal form of the name"),
]
DWORD WINAPI WNetGetUniversalName(
LPCTSTR lpLocalPath,
DWORD dwInfoLevel,
void * lpBuffer,
DWORD * lpBufferSize
);
// Other
const WORD WNFMT_MULTILINE = 0x01;
const WORD WNFMT_ABBREVIATED = 0x02;
const WORD WNFMT_INENUM = 0x10;
const WORD WNFMT_CONNECTION = 0x20;
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetGetProviderNameW"),
#else
entry("WNetGetProviderNameA"),
#endif
helpstring("Obtains the provider name for a specific type of network"),
]
DWORD WINAPI WNetGetProviderName(
DWORD dwNetType,
LPTSTR lpProviderName,
DWORD * lpBufferSize
);
const DWORD NETINFO_DLL16 = 0x00000001; // Provider running as 16 bit Winnet Driver
const DWORD NETINFO_DISKRED = 0x00000004; // Provider requires disk redirections to connect
const DWORD NETINFO_PRINTERRED = 0x00000008; // Provider requires printer redirections to connect
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetGetNetworkInformationW"),
#else
entry("WNetGetNetworkInformationA"),
#endif
helpstring("Gets extended information about a network whose name was returned by a network enumeration"),
]
DWORD WINAPI WNetGetNetworkInformation(
LPCTSTR lpProvider,
NETINFOSTRUCT * lpNetInfoStruct
);
// User Profiles
const WORD RP_LOGON = 0x01; // if set, do for logon, else for logoff
const WORD RP_INIFILE = 0x02; // if set, reconcile .INI file, else reg. hive
// Policies.
const WORD PP_DISPLAYERRORS = 0x01; // if set, display error messages, else fail silently if error
// Error handling.
[
usesgetlasterror,
#ifdef UNICODE
entry("WNetGetLastErrorW"),
#else
entry("WNetGetLastErrorA"),
#endif
helpstring("Retrieves the most recent extended error code set by a Windows network function"),
]
DWORD WINAPI WNetGetLastError(
DWORD * lpError,
LPTSTR lpErrorBuf,
DWORD nErrorBufSize,
LPTSTR lpNameBuf,
DWORD nNameBufSize);
// For Shell
const DWORD WNCON_FORNETCARD = 0x00000001;
const DWORD WNCON_NOTROUTED = 0x00000002;
const DWORD WNCON_SLOWLINK = 0x00000004;
const DWORD WNCON_DYNAMIC = 0x00000008;
[
usesgetlasterror,
#ifdef UNICODE
entry("MultinetGetConnectionPerformanceW"),
#else
entry("MultinetGetConnectionPerformanceA"),
#endif
helpstring("Gets performance information about a network connection"),
]
DWORD WINAPI MultinetGetConnectionPerformance(
NETRESOURCE * lpNetResource,
NETCONNECTINFOSTRUCT * lpNetConnectInfoStruct);
};